.\" Copyright 2008-2010 Vadim Zhukov <persgray@gmail.com>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright notice,
.\"    this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright notice,
.\"    this list of conditions and the following disclaimer in the documentation
.\"    and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY AGAVA COMPANY ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
.\" EVENT SHALL THE AGAVA COMPANY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" The views and conclusions contained in the software and documentation are
.\" those of the authors and should not be interpreted as representing official
.\" policies, either expressed or implied, of the AGAVA Company.
.Dd $Mdocdate$
.Dt RB_CPANEL 1
.Os AGAVA
.Sh NAME
.Nm rb_cpanel
.Nd operate with cPanel hosting client archives
.Sh SYNOPSIS
.Nm
info\ \ \ \&
.Ar host
.Ar client
.Ar date
.Op files
.Oo
.No mysql Ns Op \&= Ns Ar database
.Ar \&...
.Oc
.Nm
list\ \ \ \&
.Ar host
.Ar client
.Nm
list\ \ \ \&
.Ar host
.Ar client
.Ar date
.Op files
.Oo
.No mysql Ns Op \&= Ns Ar database
.Ar \&...
.Oc
.Nm
put\ \ \ \ \&
.Ar host
.Ar client
.Ar date
.Op files
.Oo
.No mysql Ns Op \&= Ns Ar database
.Ar \&...
.Oc
.Nm
restore
.Ar host
.Ar client
.Ar date
.Op files
.Oo
.No mysql Ns Op \&= Ns Ar database
.Ar \&...
.Oc
.Sh DESCRIPTION
The
.Nm
utility allows to view information about cPanel hosting clients archives, put
those archives to clients and restore client data from archives on-the-fly.
Actually,
.Nm
is just a wrapper to
.Xr rb_restore 1
that validates input to allow cPanel hosting clients archives manipulation only
and is optimized for working with such archives.
.Pp
Being executed,
.Nm
requires
.Ar command :
.Cm list ,
.Cm show ,
.Cm put
or
.Cm restore .
Those commands are described below, see
.Sx COMMANDS .
.Cm list
and
.Cm show
are synonims.
.Pp
.Ar host
and
.Ar client
options are required for all commands.
.Ar date
is required for
.Cm put
and
.Cm restore
commands.
.Pp
.Ar host
can be specified in almost any form:
.Bd -literal -offset indent
cp123.agava.net
cp123
89.108.67.168
adm.123.com1.ru
clientdomain.com
clientdomaincom.123.com1.ru
.Ed
.Pp
.Ar client
should be client name as billing say.
At this time it's not possible to specify client domain without need to specify
client name.
.Pp
You can limit list of archives used by specifying
.Dq files
or
.Dq mysql
on a command line to view files and/or MySQL databases archives only.
For databases you can either specify database names that you are interested in,
by using
.Dq mysql=database
form.
Databases can be specified in either full
.No ( Dq client0_database )
or compact
.No ( Dq database )
form.
.Pp
.Ex -std
.Sh COMMANDS
.Bl -tag -width "list, show"
.It info
Shows detailed information about particaular archive(-s).
.It list , show
Shows information about archives that belong to client.
If date was not specified, then information about all existing archives for
the client mentioned will be shown.
.It put
Copies selected archive(-s) to a client home directory on cPanel hosting server
where client resides.
.It restore
Restores (overwrites) client data on cPanel hosting server where client resides.
.Pp
When restoring files, it'll overwrite any files that have versions in archive,
but do not touch files that were not present in archive.
Be sure to create home directory first, because restoration will be done with
client system user rights, and such user cannot create home directory for
himself.
.Pp
When restoring databases, all tables that have versions in archive will be
overwritten.
Tables that are not mentioned in archive will be left intact.
Be sure to create database first, because clients cannot do this themselves.
.El
.Sh EXAMPLES
View information about archives made for client
.Dq abcru6
which owns domain
.Dq abc.ru :
.Dl $ rb_cpanel show abc.ru abcru6
.Pp
Copy all MySQL database archives for the same client on host
.Dq cp67.agava.net
to his home directory:
.Dl $ rb_cpanel put cp67.agava.net abcru6 mysql
.Pp
The same but shorter:
.Dl $ rb_cpanel put cp67 abcru6 mysql
.Pp
Restore same client's home directory and
.Dq forum
database:
.Dl $ rb_cpanel put cp67 abcru6 files mysql=forum
.Sh SEE ALSO
.Xr rb_restore 1
.Sh AUTHORS
The
.Nm
manual page was written by
.An Vadim Zhukov Aq persgray@gmail.com .
.Sh HISTORY
An
.Nm
utility appeared in
.Nm RB
toolkit 2.3.